<script type="text/javascript">
$(function() {
	//More Button
	$('.more').live("click",function() {
		var ID = $(this).attr("id");
		var duong = $('#duong').val();
		if(ID)
			{
				
				$.ajax({
					type: "POST",
					url: "pages/ket-qua-tim-kiem-duong-view-more.php",
					data: "duong="+duong+"&lastid="+ID, 
					cache: false,
					success: function(html){
					$(".place-list").append(html);
					$("#more"+ID).remove();
				}	
			});
		}
		
	
	});
});
</script>
<?
$what;
if(isset($_REQUEST['where'])){
		$what=$_REQUEST['where'];
	}
	$n=$total_place;
	
?>
<title><?=$where?> - <?=$title?></title>
<div id="maincontent">
	<div class="boxbig">
	<h1 class="titlebig">Có <?=$n?> địa điểm - <?=$where?> </h1>
    <div class="boxbigcontent">
    	<div class="search-result">
        
            <div class="clear"> </div>
            
            <div class="place-list">
            <?php
			if($n>0){
			$l = count($arrKq);
				$l_p = $arrKq[$l-1];
				$id_l = $l_p['MaDiaDiem'];
				foreach($arrKq as $row){
					$image = $xl_hinh_anh->hinhAnhDiaDiem($row['MaDiaDiem']);
					$hinhdaidien = $image[0]['DuongDan'];
					$sobinhluan = $xl_binh_luan->tong_binh_luan($row['MaDiaDiem']);
			?>
            		<div class="place-item"><!--một địa điểm-->
                	<div class="place-avatar">
                    	<?
							if($hinhdaidien != ''){					
						?>
                        <a href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>">
                        <img src="uploads/place/<?=$hinhdaidien?>" alt="<?=$row['TenDiaDiem']?>">
                        </a>
						<? } else{?>
                        <a href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>">
                        	<img src="uploads/place/photo_not_available.png" alt="<?=$row['TenDiaDiem']?>">
                        </a>
                        <? }?>
                    </div>
                    <ul class="place-info">
                    	<li class="first">
                        	<a class="place-title" title="<?=$row['TenDiaDiem']?>" href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>"><?=$row['TenDiaDiem']?></a>
                        </li>
                        <li>
                        <span class="address-details"><?=$row['DiaChi']?> - <?=$row['TenQuanHuyen']?> - <?=$row['TenTinhThanh']?></span>
                        </li>
                        <li>
                        <img class="icon" title="lượt xem" src="images/icon_views.png">
                        Lượt xem:
                        <span class="page-views"><?= number_format($row['SoLuotXem'],0,',',',')?></span>
                        </li>
                        <li>
                        <img class="icon" title="bình luận" src="images/icon_comment.png">
                        Bình luận:
                        <span class="comment-no"><?=number_format($sobinhluan,0,',',',')?></span>
                        </li>
                        
                    </ul>
                	<div class="clear"></div>
                </div><!--[end] một địa điểm-->
                <?
				}
			}
			else
			{
				?>
                <div class="search-result">
                không có địa điểm nào được tìm thấy!!!
                </div>
                <?
			}
			if($l>=10)
			{
                ?>
                <div class="place-item last" id="more<?=$id_l?>"><!--xem thêm-->
                	<input type="hidden" id="duong" name="duong" value="<?=$duong?>" />
                	<a id="<?=$id_l?>" class="more">xem thêm</a>
					<div class="clear"></div>
                </div><!--[end] xem thêm-->
                <? } ?>
            </div>
        </div>
    </div>
<div class="boxbigcontentbottom"></div>

    </div>
</div>
<!--menu right-->
<!--menu right-->
<div id="nav">
	<div class="boxnav">
    	<h3 class="titlenav"> Địa điểm mới cập nhật</h3>
    	<div class="boxnavcontent">
        	<div class="place-list-small"><!--danh sách địa điểm-->
            	<?
					foreach($arrDiaDiemMoiCapNhat as $row){
						$arrPic = $xl_hinh_anh->hinhAnhDiaDiem($row['MaDiaDiem']);
						$pic = $arrPic[0]['DuongDan'];
						$sobinhluan = $xl_binh_luan->tong_binh_luan($row['MaDiaDiem']);
				?>
                <div class="place-item">
                    <div class="place-avatar">
                    <a class="placeTracking" href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>">
                    <img  src="uploads/place/<? if($pic!=""){ echo $pic; }else{ ?>photo_not_available.png<? } ?>" alt="<?=$row['TenDiaDiem']?>">
                    </a>
                    </div>
                    <ul class="place-info">
                    <li>
                    <a class="place-title placeTracking" title="<?=$row['TenDiaDiem']?>" href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>"><?=$row['TenDiaDiem']?></a>
                    </li>
                    <li>
                    <span class="address-details"><?=$row['DiaChi']?></span>
                    </li>
                    <li>
                    <div class="icon">
                    <img title="lượt xem" src="images/icon_views.png">
                    <span title="lượt xem"><?= number_format($row['SoLuotXem'],0,',',',')?></span> Lượt xem
                    <img title="bình luận" src="images/icon_comment.png">
                    <span title="bình luận"><?=number_format($sobinhluan,0,',',',')?></span> Bình luận
                    </div>
                    </li>
                    </ul>
                    <div class="clear"> </div>
                 </div>
                <? } ?>
               
                
            </div><!--[end] danh sách địa điểm -->
            
           
            
        </div>
    </div>
</div>
 <div class="boxbigcontentbottom"></div>
<div class="clear"></div>